export interface User {
  id: number;
  name: string;
  phone: string;
  email: string;
  head?: string;
  signature?: string;
  gender: number;
  password: string;
}


export interface MyResponse<T> {
  message: string
  data: T
  suc: boolean
}

export interface Class {
  id: number;
  name: string;
  head?: string;
  create_time: string;
  code: string;
}

export interface ClassLog {
  id: number;
  date: string;
  u_id: number;
  c_id: number;
  description: string;
}

export interface ExamLog {
  id: number;
  date: string;
  u_id: number;
  e_id: number;
  description: string;
}

export interface MyLog {
  log: ClassLog | ExamLog;
  user: User;
  logEntity: Class | Exam;
}

export interface Exam {
  id: number;
  c_id: number;
  name: string;
  start_time: string;
  end_time: string;
  total_score: number;
  pass_score: number;
  create_time: string;
}

export interface Question {
  id?: number;
  content: string;
  u_id:number;
  type: number;
}

export interface SearchQuestion{
  contentResult:Question[]
  tagResult:Question[]
  userResult:Question[]
  otherResult:Question[]
}

export interface Tag{
  id?:number
  name:string
}

export interface QuestionTag{
  id?:number
  t_id:number
  q_id:number
}

export interface Grade extends GradeRow{
  id: number;
}

export interface GradeRow{
  u_id: number;
  e_id: number;
  pass: number
  teacherShow: number
  userCommit: number
  right_count:number
}

export interface QuestionAnswer extends TempQuestionAnswer {
  id?: number;
  q_id?: number;
}

export interface TempQuestionAnswer {
  answer: string,
  isRight: boolean
}

export interface UserAnswerList {
  q_id: number;
  u_id: number;
  answerList?:string[];
}

export interface UserAnswer{
  id?:number;
  q_id: number;
  e_id:number;
  u_id: number;
  answer:string
}



export interface QuestionAndAnswer extends Question {
  answerList: QuestionAnswer[]
}

export interface MyDialog{
  msg:string,
  show:boolean,
  confirmFn?:Function,
  closeFn?:Function,
  suc:boolean
}

export interface ClassNoticeRow{
  title:string
  content:string
  u_id:number
  c_id:number
  datetime:string
}
export interface ClassNotice extends ClassNoticeRow{
  id:number
}
//问题类型
export const questionTypes = ["选择", "多选", "判断"]
//字母数组
export const Alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']